package xyz.zyt123.hikvideo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.zyt123.hikvideo.bean.SysLog;
import xyz.zyt123.hikvideo.bean.User;
import xyz.zyt123.hikvideo.dao.SysLogMapper;
import xyz.zyt123.hikvideo.service.SysLogService;

import java.util.Date;

/**
 * @author zhuyuntao
 */
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
  @Override
  public void saveSysLog(User user, String content) {
    SysLog sysLog = new SysLog();
    sysLog.setTime(new Date());
    sysLog.setContent(content);
    sysLog.setUserId(user.getId());
    sysLog.setUserName(user.getNickname());
    save(sysLog);
  }
}
